package com.yxhl.zoume.common.ui.custom;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ScrollView;

import com.yxhl.zoume.utils.DensityUtils;


/**
 * Created by vhawk on 15/10/15.
 */
public class SmartScrollView extends ScrollView {
    public SmartScrollView(Context context) {
        super(context);
    }

    public SmartScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public SmartScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {

        int y = (int) ev.getY();
        if (y < DensityUtils.dip2px(getContext(), 320)) {
            return false;
        } else {

            return super.onInterceptTouchEvent(ev);

        }
    }
}
